<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCaHandoverRecords extends \App\Utils\CreateMigration
{
    function columns(Blueprint $table)
    {
        $table->unsignedBigInteger('from_user_id')->nullable()->comment('来源用户ID');
        $table->unsignedBigInteger('to_user_id')->nullable()->comment('目的用户ID');
        $table->unsignedBigInteger('user_id')->nullable()->comment('操作员');
        $table->unsignedTinyInteger('type')->nullable()->comment('类型@AG');
        $table->integer('data_count')->default(0)->comment('数据条数');
        $table->longText('customer_ids')->nullable()->comment('转移的客户ID');
    }

    function tableInfo()
    {
        return ['ca__handover_records', '咨询预约-交接记录'];
    }

    public function getData()
    {
        \App\Utils\MigrationUtil::addCodes('AG', '交接类型', [
            1 => '咨询',
            2 => '话务'
        ]);

        return parent::getData();
    }
}
